<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f"%>
<%@ taglib uri="/mytag" prefix="yjd"%>
<div class="wrap">
	<div class="nav">
		<ul class="cc">
			<li class="current"><a href="#">注册用户统计</a></li>
			<li><a href="<yjd:url url="/userstatis/invest"/>">投资用户统计</a></li>
		</ul>
	</div>
	<div class="h_a">
		<h2>注册用户</h2>
	</div>
	
	<div class="search_type cc mb10">
			<form action="/userstatis/user.action" method="get" autocomplete="off">
				<label>开始日期：</label><input name="begin_time" type="text" class="input length_3 mr5 J_datetime date offchange" value="${begin_time }">
				<label>截至日期：</label><input name="end_time" type="text" class="input length_3 mr5 J_datetime date offchange" value="${end_time }">
				<button type="submit" class="btn btn_submit btn_green">搜索</button>
				<a href="<yjd:url url="/invite/panel"/>" class="btn btn_yellow">去推广</a>
			</form>
	</div>
	
	<div class="table_full">
		<table style="width:350px;" cellspacing="0" border="1" bordercolor="#DFC5A4">
			<tbody>
				<tr>
					<td>总计(人)</td>
					<td>${userCount }</td>
				</tr>
			</tbody>
		</table>
	</div>

	<div class="h_a">
		<h2>用户年龄段</h2>
	</div>
	<div class="table_full">
		<table style="width:350px;" cellspacing="0" border="1"
			bordercolor="#DFC5A4">
			<tbody>
				<tr>
					<td>年龄段(岁)</td>
					<td>占比</td>
				</tr>
				<c:forEach items="${user_age_group }" var="age_group">
				<tr>
					<td>
					<c:if test="${fn:endsWith(age_group.key, '_')}">
					   ${fn:substring(age_group.key,0,2)}岁
					</c:if>
					<c:if test="${!fn:endsWith(age_group.key, '_')}">
					  ${age_group.key }岁
					</c:if>
					</td>
					<td>
					<c:if test="${userCount==0 }">-</c:if>
					<c:if test="${userCount>0 }">
					<f:formatNumber value="${age_group.value / userCount*100 }" pattern="0.0000" />%
					</c:if>
					</td>
				</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>


	<div class="h_a">
		<h2>用户集中城市</h2>
	</div>
	<div class="table_full">
		<table style="width:350px;" cellspacing="0" border="1"
			bordercolor="#DFC5A4">
			<tbody>
				<tr>
					<td>城市</td>
					<td>占比</td>
				</tr>
				<c:forEach items="${user_city_group }" var="city_group">
				<tr>
					<td>${city_group.sheng }</td>
					<td>
					<c:if test="${userCount==0 }">-</c:if>
					<c:if test="${userCount>0 }">
					<f:formatNumber value="${city_group.cnt / userCount*100 }" pattern="0.0000"/>%
					</c:if>
					</td>
				</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>


	<div class="h_a">
		<h2>引流平台</h2>
	</div>
	<div class="table_full">
		<table style="width:350px;" cellspacing="0" border="1"
			bordercolor="#DFC5A4">
			<tbody>
				<tr>
					<td>引流来源</td>
					<td>注册人数(人)</td>
				</tr>
				<c:forEach items="${channel_user_group }" var="channel_group">
				<tr>
					<td>${channel_group.channel_name }
					<a href="<yjd:url url="/userstatis/channel_reguser_statistic_list"/>?channel_code=${channel_group.reg_channel }&begin_time=${reg_begin_time }&end_time=${reg_end_time }" class="red">查看详细</a> 
					</td>
					<td>${channel_group.cnt}</td>
				</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>


	<div class="h_a">
		<h2>各时间段网站注册人数</h2>
	</div>
	<div class="table_full">
		<table style="width:350px;" cellspacing="0" border="1"
			bordercolor="#DFC5A4">
			<tbody>
				<tr>
					<td>时间段</td>
					<td>注册人数(人)</td>
				</tr>
				<c:forEach items="${user_hours_group }" var="hour_group">
				<tr>
					<td>${hour_group.key }点</td>
					<td>${hour_group.value}</td>
				</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>
</div>